/***************************************************************************
 * File name: EPubMediaJPEGImp.h
 * Original author: caizhifei2003@163.com
 * Date: 2013.03.04
 ***************************************************************************/
#ifndef _EPUB_MEDIA_JPEG_IMP_H_
#define _EPUB_MEDIA_JPEG_IMP_H_

#include "IEPubMediaJPEG.h"
#include "EPubBufferImp.h"
#include <string>

class EPubMediaJPEGImp : public IEPubMediaJPEG
{
public:
	virtual EPUB_MediaFileType GetMediaFileType() const { return EPUB_MFT_JPEG; }
	virtual const char *GetHref() const { return m_Href.c_str(); };
	virtual void SetHref(const char *href) { m_Href = href; }

	virtual EPubPointer<IEPubBuffer> Serialize(EPubPointer<IEPubEncryption> encryption = NULL) const;
	virtual EPUB_Result Deserialize(const EPubPointer<IEPubBuffer> buffer, EPubPointer<IEPubDecryption> decryption = NULL);

	virtual EPubPointer<IEPubBuffer> GetBuffer() const { return m_Buffer.Cast<IEPubBuffer>(); };
	virtual void SetBuffer(const EPubPointer<IEPubBuffer> buffer) { m_Buffer->SetBuffer(**buffer); }

private:
	std::string						m_Href;
	EPubPointer<EPubBufferImp>		m_Buffer;

};

#endif // _EPUB_MEDIA_JPEG_IMP_H_